using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using PMQLCHH.DTO;
using PMQLCHH.BUS;

namespace PMQLCHH.GUI
{
    public partial class LICHNHACNHO : DevComponents.DotNetBar.Office2007Form
    {
        public LICHNHACNHO()
        {
            InitializeComponent();
        }

        private void LICHNHACNHO_Load(object sender, EventArgs e)
        {
            NapDuLieu();
        }

        public void NapDuLieu()
        {
            string ngay = Get_Day() + "/" + Get_Month() + "/" + Get_Year();
            lbl_ngaynhacnho.Text = ngay.ToString();
            DataTable dt = HoaDonBUS.Load_List_HoaDon_Theo_Ngay(ngay);
            if (dt.Rows.Count > 0)
            {
                dtg_lichnhacnho.AutoGenerateColumns = false;
                dtg_lichnhacnho.DataSource = dt;
            }
        }

        public string Get_Day() 
        { 
            string str = DateTime.Now.ToString().Trim(); str = str.Substring(0, 2); return str; 
        }
         
        public string Get_Month() 
        { 
            string str = DateTime.Now.ToString().Trim(); str = str.Substring(3, 2); return str; 
        }
         
        public string Get_Year() 
        { 
            string str = DateTime.Now.ToString().Trim(); str = str.Substring(6, 4); return str; 
        }
    }
}